﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PublishSoftwareWebPageCreator
{
    public class Page
    {
        public Page()
        {
        }

        public Page(string _page, string _dir)
        {
            this.page = _page;
            this.dir = _dir;
            Random rd = new Random();
            this.port = rd.Next(7001, 7999);
        }

        public string page;
        public string dir;
        public int port;

        public override string ToString()
        {
            return page;
        }

        public string takeDir()
        {
            var pages = "pages";

            if (!Directory.Exists(pages))
            {
                Directory.CreateDirectory(pages);
            }

            var path = System.Environment.CurrentDirectory + "\\" + pages + "\\" + dir;

            return path;
        }
    }
}
